function output = explain(input, num_players_r, num_players_b)

x_tiles = 8;
y_tiles = 4;
distance_tiles = 14; % distance varies between 0 and 135; 14*10 = 140
angle_tiles = 8; % 8*45 = 360
num_tilings = 32;

% group features for x coordinate of the ball

ball_x = num_tilings*(x_tiles+1) - 1;
ball_y = ball_x + num_tilings*(y_tiles+1) - 1;

distance_dim = num_tilings*(distance_tiles+1) - 1;
angle_dim = num_tilings*(angle_tiles+1) - 1;

for index = 1:numel(input),
    if(input(index) <= ball_x)
        output{index} = 'ball_x';
    elseif(input(index) <= ball_y)
        output{index} = 'ball_y';
    else
        for teammate = 1:(num_players_r+num_players_b)
           if(input(index) <= ball_y + teammate*distance_dim + (teammate-1)*angle_dim)
                output{index} = sprintf('player %s distance', num2str(teammate));
                break;
           elseif(input(index) <= ball_y + teammate*distance_dim + teammate*angle_dim)
                output{index} = sprintf('player %s angle', num2str(teammate));
                break;
           end
        end
        %output{index} = 'player';
    end
end

end